package ar.edu.sovietrussia.customcomponents.loaning;

import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.Form;

import ar.edu.sovietrussia.customcomponents.util.BackToMainWindowGenericComponent;

/**
 * Description: in the name of the class :)
 */

@AuthorizeInstantiation({ "USER", "ADMIN" })
public abstract class CannotLoanDueToMaxLoansReachedComponent extends BackToMainWindowGenericComponent {

    private static final long serialVersionUID = -615060423545831325L;

    public CannotLoanDueToMaxLoansReachedComponent(final String id) {
        super(id);

        Form<String> form = new Form<String>("cannotLoanForm");

        form.add(new Label("descriptionLabel", "No se pudo gestionar prestamo. "));
        form.add(new Label("reasonLabel", "Maximo de prestamos alcanzado. "));

        // Cancel Button
        form.add(new Button("goBack_button") {
            private static final long serialVersionUID = 5119888790644143879L;

            @Override
            public void onSubmit() {
                CannotLoanDueToMaxLoansReachedComponent.this.goBack();
            }

        });

        this.add(form);
    }

}
